/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trial.entity;

import java.io.Serializable;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 * @author feifei
 */
@Embeddable
@XmlType(name = "CustomerAddr", propOrder = {
"country",
"zipcode"
})
public class CustomerAddr implements Serializable {
    String country;
    String zipcode;

    public CustomerAddr() {
    }

    public CustomerAddr(String country, String zipcode) {
        this.country=country;
        this.zipcode=zipcode;
    }

    @Override
    public String toString() {
        return "CustomerAddr{" + "Country=" + country + ", zipcode=" + zipcode + '}';
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getZipcode() {
        return zipcode;
    }

    public void setZipcode(String zipcode) {
        this.zipcode = zipcode;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final CustomerAddr other = (CustomerAddr) obj;
        if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) {
            return false;
        }
        if ((this.zipcode == null) ? (other.zipcode != null) : !this.zipcode.equals(other.zipcode)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 19 * hash + (this.country != null ? this.country.hashCode() : 0);
        hash = 19 * hash + (this.zipcode != null ? this.zipcode.hashCode() : 0);
        return hash;
    }
    
}
